package com.leizi.igym.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leizi.igym.domain.Member;
import com.leizi.igym.dto.DoughnutStatisticsDTO;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
* @author PC
* @description 针对表【t_member】的数据库操作Mapper
* @createDate 2024-04-29 09:45:06
* @Entity com.leizi.igym.domain.Member
*/
public interface MemberMapper extends BaseMapper<Member> {

    List<DoughnutStatisticsDTO> selectDoughnutStatisticsByGender();

    List<DoughnutStatisticsDTO> selectDoughnutStatisticsByLevel();

    List<DoughnutStatisticsDTO> selectDoughnutStatisticsByAge();

    @Select("select count(0) from t_member tm where tm.create_time <=#{endTime} and tm.deleted = 0;")
    Integer selectAllCount(Map map);

    @Select("select count(0) from t_member tm where tm.create_time <=#{endTime} and tm.create_time >= #{beginTime} and tm.deleted = 0;")
    Integer selectNewCount(Map map);
}




